﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.master" Inherits="System.Web.Mvc.ViewPage<IEnumerable<PorteringManagement.Model.Cargo>>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    Cargas
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

<h2>Lista de Cargas</h2>

<p>
    <%: Html.ActionLink("Nueva Carga", "Create") %>
</p>
<table>
    <tr>
        <th>
            Tipo de Carga
        </th>
        <th>
            Cliente
        </th>
        <th>
            Itinerario
        </th>
        <th>
            Nombre
        </th>
        <th>
            Descripción
        </th>
        <th>
            Tamaño
        </th>
        <th>
            Peso
        </th>
        <th></th>
    </tr>

<% foreach (var item in Model) { %>
    <tr>
        <td>
            <%: Html.DisplayFor(modelItem => item.CargoType.Name) %>
        </td>
        <td>
            <%: Html.DisplayFor(modelItem => item.Customer.Name) %>
        </td>
        <td>
            <%: Html.DisplayFor(modelItem => item.Itinerary.Name) %>
        </td>
        <td>
            <%: Html.DisplayFor(modelItem => item.Name) %>
        </td>
        <td>
            <%: Html.DisplayFor(modelItem => item.Descripion) %>
        </td>
        <td>
            <%: Html.DisplayFor(modelItem => item.Size) %>
        </td>
        <td>
            <%: Html.DisplayFor(modelItem => item.Weight) %>
        </td>
        <td>
            <%: Html.ActionLink("Editar", "Edit", new { id=item.CargoID }) %> |
            <%: Html.ActionLink("Detalles", "Details", new { id=item.CargoID }) %> |
            <%: Html.ActionLink("Eliminar", "Delete", new { id=item.CargoID }) %>
        </td>
    </tr>
<% } %>

</table>

</asp:Content>
